#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

int main()
{
    int i, n, *p, a;
    p=NULL;
    
    //Create a dynamic array with n elements
    printf ("How many element do you want to input? - ");
    scanf ("%d", &n);
    p=malloc (n*sizeof (int));
    
    
    //Enter the value for each element in this array
    for (i=0; i<n; i++)
    {
        printf ("\nEnter the elements no.%d: ", i+1);
        scanf ("%d", &p[i]);
        
        }
     a=check_palindrome (p, n); 
     //printf("%d", a);      
    if (a==1) printf ("\nThis array is palindrome!!!");
    else printf ("\nThis array isn't palindrome!!!");
     getch();        
}


int check_palindrome (int *p, int n)
{
    int i=0, j=n-1, flag;
    //flag=1;// Use flag as a signal to check if this array this palindrome or not   
     for(i=0;i<(n/2); i++)
            if ((*(p+i)) != (*(p+n-i-1)))
                         return 0;
     return 1;
          //return flag;
}
